package com.singzi.leetcode.N100;


import java.util.ArrayList;
import java.util.List;

public class T0094 {
}
class Solution0094 {
    private List<Integer> list = new ArrayList<>();
    public List<Integer> inorderTraversal(TreeNode root) {
        if(root==null) return list;

        else{
            inorder(root);
            return list;

        }


    }
    public void inorder(TreeNode root){
        if(root.left != null) inorder(root.left);
        list.add(root.val);
        if(root.right != null) inorder(root.right);
    }
}